import request from '@/utils/request'

//获取消息数据
export function getNoticePageList(params) {
	return request({
		method: 'get',
		url: 'sysNotice/query',
		params
	})
}

//获取私信数据
export function getPrivateLetterData(params) {
	return request({
		method: 'get',
		url: 'sysNotice/queryNoticeByOneSelf',
		params
	})
}

//获取消息详情
export function noticeDetail(id) {
	return request({
		method: 'get',
		url: 'sysNotice/query/' + id
	})
}

//新增消息
export function addNotice(data) {
	return request({
		method: 'post',
		url: 'sysNotice/add',
		data,
	})
}

//删除消息
export function deleteNotice(id) {
	return request({
		method: 'get',
		url: 'sysNotice/deleteById/' + id
	})
}

//删除私信
export function deletePrivateLetter(params) {
	return request({
		method: 'post',
		url: 'sysNotice/deleteByOneSelf',
		params
	})
}

//修改消息
export function updateNotice(data) {
	return request({
		method: 'post',
		url: 'sysNotice/update',
		data,
	})
}

//阅读所有信件
export function readAllLetter() {
	return request({
		method: 'post',
		url: 'sysNotice/readAllNotice'
	})
}

//阅读单条信件
export function readOneLetter(id) {
	return request({
		method: 'get',
		url: 'sysNotice/readNotice/' + id
	})
}